<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ tag import="java.text.SimpleDateFormat"%>
<%@ tag import="java.util.*"%>
<%@ attribute name="sendtime" required="true" type="java.util.Date"%>
<%
String str="";
int ay=new Date().getYear();
int by=sendtime.getYear();
int a=new GregorianCalendar().get(Calendar.DAY_OF_YEAR);
int b=new GregorianCalendar(sendtime.getYear(),sendtime.getMonth(),sendtime.getDate()).get(Calendar.DAY_OF_YEAR);
if(ay==by  && b==a){
	str=" 今天";
}
if(ay==by && a-b==1){
	str=" 昨天";
}
String str1="星期";
switch(sendtime.getDay()){
case 0:str1+="天";break;
case 1:str1+="一";break;
case 2:str1+="二";break;
case 3:str1+="三";break;
case 4:str1+="四";break;
case 5:str1+="五";break;
case 6:str1+="六";break;
}
SimpleDateFormat df=new SimpleDateFormat("yyyy年MM月dd日("+str1+")"+str+" HH:mm:ss");
out.print(df.format(sendtime));


%>